package game.efficientCollisionPrediction;

import java.util.*;

public class FutureCollisionComparator implements Comparator<FutureCollision> {

	@Override
	public int compare(FutureCollision arg0, FutureCollision arg1) {
		if(arg0 == null && arg1 == null)
			return 0;
		if(arg0 == null || arg0.getCollisionMoment() == null)
			return +1;
		if(arg1 == null || arg1.getCollisionMoment() == null)
			return -1;
		
		return arg0.getCollisionMoment().compareTo(arg1.getCollisionMoment());
	}
	

}
